<?php
/**
 * Promotion Constant
 *
 * @author fusq
 */

class PromotionConstant {

	public static $freeShippingPromotionType = 1;

	public static function getCouponTypeList(){
		$translate = Zend_Registry::get('Zend_Translate');
		$type = array(
		2 => $translate->_('productPromotion'),
		3 => $translate->_('orderPromotion'),
		4 => $translate->_('salePromotion')
		);
		return $type;
	}
	public static function getRestrictionTypeList(){
		$translate = Zend_Registry::get('Zend_Translate');
		$type = array(
		1 => $translate->_('productRestriction'),
		2 => $translate->_('categoryRestriction'),
		3 => $translate->_('subTotalRestriction'),
		4 => $translate->_('paymentmethod'),
		5 => $translate->_('shippingmethod'),
		6 => $translate->_('customerRestriction'),
		7 => $translate->_('codeRestriction'),
		8 => $translate->_('customerCertfRestriction'),
		9 => $translate->_('customerRankRestriction')
		);
		return $type;
	}
	public static function getRestrictionType($keyarr){
		$type = PromotionConstant::getRestrictionTypeList();
		foreach($keyarr as $key => $value){
			$rtype[$value] = $type[$value];
		}
		return $rtype;
	}
	public static function getActionTypeList(){
		$translate = Zend_Registry::get('Zend_Translate');
		$type = array(
		1 => $translate->_('percentOff'),
		2 => $translate->_('amountOff'),
		3 => $translate->_('freeShipping'),
		4 => $translate->_('getsecondpercentoff'),
		5 => $translate->_('getsecondamountoff')
		);
		return $type;
	}
	public static function getActionType($keyarr){
		$type = PromotionConstant::getActionTypeList();
		foreach($keyarr as $key => $value){
			$rtype[$value] = $type[$value];
		}
		return $rtype;
	}
	public static function getTimeList(){
		for($i=0;$i<24;$i++){
			if($i<10){
				$hour[] = '0' . $i;
			}else{
				$hour[] = $i;
			}
		}
		for($i=0;$i<60;$i++){
			if($i<10){
				$min[] = '0' . $i;
			}else{
				$min[] = $i;
			}
		}

	 for($i=0;$i<60;$i++){
	 	if($i<10){
	 		$sec[] = '0' . $i;
	 	}else{
	 		$sec[] = $i;
	 	}
	 }
		$result['hour']=$hour;
		$result['min']=$min;
		$result['sec']=$sec;
		return $result;
	}
	public static function getSubroralOperatorList(){
		$translate = Zend_Registry::get('Zend_Translate');
		$operator = array(
		1 => $translate->_('equal'),
		2 => $translate->_('greaterthan'),
		3 => $translate->_('lessthan'),
		4 => $translate->_('equalorgreaterthan'),
		5 => $translate->_('equalorlessthan')
		);
		return $operator;
	}
}
?>